package userdao

import (
	"go-small-shopping/db"
	"go-small-shopping/entity/user"
)

func FindUserById(query *entity_user.UserInfo) (*entity_user.UserInfo, error) {
	con := db.GetBbCon()

	rs := &entity_user.UserInfo{}

	con.Where(query).First(rs)

	return rs, nil
}

func FindUserByEntity(query *entity_user.UserInfo) *entity_user.UserInfo {
	con := db.GetBbCon()
	rs := &entity_user.UserInfo{}
	con.Where(query).First(rs)
	return rs
}
